#include "mainwindow.h"
#include "ui_mainwindow.h"
#include<QMessageBox>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    this->sc=new scene;
    this->ui->graphicsView->setScene(sc);
}

MainWindow::~MainWindow()
{
    delete ui;
}
void MainWindow::closeEvent(QCloseEvent *event)    //实现关闭程序的函数
{
    int ret= QMessageBox::question(this,"确定","你真的要关闭吗？","Yes","No");
    //judge 是否关闭
    if(ret==1){
        event->ignore();
    }
}
